home *** CD-ROM | disk | FTP | other *** search
- !
- ! Copyright (c) 1995
- ! by CompuServe Incorporated, Columbus, Ohio
- !
- ! The information in this software is subject to change without
- ! notice and should not be construed as a commitment by CompuServe.
- !
- ! SECLOG:
- ! Handles secure login.
- !
- !+V
- ! "3.6"
- !-V
-
- define %SecFailTemp = "";
- define %LF = "^J";
-
- wait
- "." goto Host_Challenge_Received
- until 100;
- goto Timeout;
-
- Host_Challenge_Received:
- HostChallenge = %Scanned;
-
- send "RB:" & %CR & %LF & %MicroChallenge & "." & %CR & %LF;
-
- define %UserResponse = "";
- encode HostChallenge, %MicroChallenge, %Password, %UserResponse;
-
- if %UserResponse <> "" goto Send_Micro_Response;
-
- define %SecFailTemp = "Application error, out of resources";
- define %ErrorCode = 33;
- exit %Failure;
-
- Send_Micro_Response:
- send "UR:" & %CR & %LF & %UserResponse & "." & %CR & %LF;
-
- wait
- "No." goto Response_Refused,
- "HR:" goto Handle_Host_Response
- until 100;
- goto Timeout;
-
- Response_Refused:
- define %SecFailTemp = "Incorrect User ID or password";
- define %ErrorCode = 34;
- exit %Failure;
-
-
- Handle_Host_Response:
-
- wait
- "." goto Host_Response_Received
- until 100;
-
- Timeout:
- define %SecFailTemp = "Host not responding to secure login request";
- define %ErrorCode = 32;
- exit %Failure;
-
-
- Host_Response_Received:
- define %HostResponse = %Scanned;
- define %Approved = 0;
-
- approve HostChallenge, %MicroChallenge, %Password, %HostResponse, %Approved;
-
- if %Approved <> 0 goto Host_Response_Approved;
-
- define %SecFailTemp = "Secure response from host was invalid";
- define %ErrorCode = 35;
- exit %Failure;
-
- Host_Response_Approved:
- exit %Success;
-